<?php

/**
 * ContactVoyage form base class.
 *
 * @method ContactVoyage getObject() Returns the current form's model object
 *
 * @package    lointains-espace
 * @subpackage form
 * @author     William Ong
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseContactVoyageForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'destination'   => new sfWidgetFormInputText(),
      'region'        => new sfWidgetFormInputText(),
      'date_depart'   => new sfWidgetFormDateTime(),
      'duree_voyage'  => new sfWidgetFormInputText(),
      'nombre_adulte' => new sfWidgetFormInputText(),
      'nombre_enfant' => new sfWidgetFormInputText(),
      'budget'        => new sfWidgetFormInputText(),
      'desc_projet'   => new sfWidgetFormTextarea(),
      'civilite'      => new sfWidgetFormInputText(),
      'nom'           => new sfWidgetFormInputText(),
      'prenom'        => new sfWidgetFormInputText(),
      'adresse'       => new sfWidgetFormInputText(),
      'code_postal'   => new sfWidgetFormInputText(),
      'ville'         => new sfWidgetFormInputText(),
      'pays'          => new sfWidgetFormInputText(),
      'email'         => new sfWidgetFormInputText(),
      'telephone'     => new sfWidgetFormInputText(),
      'site_connu'    => new sfWidgetFormInputText(),
      'newsletter'    => new sfWidgetFormInputCheckbox(),
      'created_at'    => new sfWidgetFormDateTime(),
      'updated_at'    => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'destination'   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'region'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'date_depart'   => new sfValidatorDateTime(array('required' => false)),
      'duree_voyage'  => new sfValidatorInteger(array('required' => false)),
      'nombre_adulte' => new sfValidatorInteger(array('required' => false)),
      'nombre_enfant' => new sfValidatorInteger(array('required' => false)),
      'budget'        => new sfValidatorInteger(array('required' => false)),
      'desc_projet'   => new sfValidatorString(array('max_length' => 1000, 'required' => false)),
      'civilite'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'nom'           => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'prenom'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'adresse'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'code_postal'   => new sfValidatorInteger(array('required' => false)),
      'ville'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'pays'          => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'email'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'telephone'     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'site_connu'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'newsletter'    => new sfValidatorBoolean(array('required' => false)),
      'created_at'    => new sfValidatorDateTime(),
      'updated_at'    => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('contact_voyage[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'ContactVoyage';
  }

}
